<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:fragment="head">
    <link rel="stylesheet" th:href="@{/Ui/layui-v2.6.4/layui/css/layui.css}">
    <link rel="stylesheet" th:href="@{/Ui/bootstrap/css/bootstrap.css}">
    <style>
        a{
            text-decoration: none!important;
        }
    </style>
</head>
<body>
<!--头部导航栏-->
<div th:fragment="top">
    <ul class="layui-nav text-primary navbar-fixed-top">
        <li class="layui-nav-item "><a href=""></a></li>
        <li class="layui-nav-item "><a href=""></a></li>
        <li class="layui-nav-item"><img th:src="@{/admin/img/1.png}" alt="Login" class="layui-nav-img">
        <li class="layui-nav-item "><a th:href="@{/blog/index}">首页</a></li>

        <!--登录之后会显示个人收藏-->
        <li class="layui-nav-item"><a th:href="@{/blog/toIframe/(userId=${session.id})}">学习</a></li>
        <li class="layui-nav-item I"><a th:href="@{/toRegister}">&nbsp;&nbsp;&nbsp;</a></li>
        <li class="layui-nav-item I"><a th:href="@{/toAbout}">我们</a></li>
        <li class="layui-nav-item I" th:if="${session.user}">
            <a th:href="@{/blog/blogadmin}"><img th:src="@{/abc/}+${session.headPath}" class="layui-nav-img" th:text="${session.user}"></a>
            <dl class="layui-nav-child">
                <dd><a th:href="@{/logout}">退出</a></dd>
            </dl>
        </li>
        <li class="layui-nav-item I" th:if="not ${session.user}"><a th:href="@{/blog/toLogin}">登录</a></li>
        <li class="layui-nav-item I"><a th:href="@{/toRegister}">注册</a></li>
    </ul>
</div>

<div id="commonjs">
    <script  th:src="@{/Ui/layui-v2.6.4/layui/layui.js}"></script>
    <script  th:src="@{/Ui/bootstrap/js/bootstrap.js}"></script>
    <script>
        //JS
        layui.use(['element', 'layer', 'util'], function () {
            var element = layui.element
                , layer = layui.layer
                , util = layui.util
                , $ = layui.$;

            //头部事件
            util.event('lay-header-event', {
                //左侧菜单事件
                menuLeft: function (othis) {
                    layer.msg('展开左侧菜单的操作', {icon: 0});
                }
                , menuRight: function () {
                    layer.open({
                        type: 1
                        , content: '<div style="padding: 15px;">处理右侧面板的操作</div>'
                        , area: ['260px', '100%']
                        , offset: 'rt' //右上角
                        , anim: 5
                        , shadeClose: true
                    });
                }
            });

        });
    </script>

</div>

<!--后台框架-->
<div th:fragment="adminjia">
    <div class="layui-header">
        <div class="layui-logo layui-hide-xs layui-bg-black">博客后台</div>
        <!-- 头部区域（可配合layui 已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">
            <!-- 移动端显示 -->
            <li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-header-event="menuLeft">
                <i class="layui-icon layui-icon-spread-left"></i>
            </li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item layui-hide layui-show-md-inline-block">
                <a href="javascript:;">
                    <img th:src="@{/abc/}+${session.headPath}"
                         class="layui-nav-img">
                    [[${session.user}]]
                </a>
                <dl class="layui-nav-child">
                    <dd><a th:href="@{/logout}">退出</a></dd>
                </dl>
            </li>
        </ul>
    </div>
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <li class="layui-nav-item"><a th:href="@{/blog/blogadmin}">首页</a></li>
                <li class="layui-nav-item layui-nav-itemed">
                    <a>博客管理</a>
                    <dl class="layui-nav-child">
                        <dd><a th:href="@{/blog/toNewBlog}">发表博客</a></dd>
                        <dd><a th:href="@{/toDeleteBAdmin}">删除博客</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">系统设置</a>
                    <dl class="layui-nav-child">
                        <dd><a href="/toUpdatePwd">修改密码</a></dd>
                        <dd><a href="/updateHead">设置头像</a></dd>
                        <dd><a th:href="@{/logout}">退出登陆</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>
</div>



</body>
</html>